function Node() {
	this.parent = null;
	this.children = [];   // children Nodes. If children is empty, it means that this is a leaf node
	this.content = null;
	this.type = null;
	this.id = null;
}

Node.prototype.setContent = function(content) {
	this.content = content;
}
Node.prototype.setType = function(type) {
	this.type = type;
}

Node.prototype.addChildNode = function(childNode) {
	this.children.push(childNode);
}

Node.prototype.getNavigationHtml = function() {
	var htmlSoFar = "";
	if (this.id == vleState.getCurrentNodeVisit().node.id) {
		htmlSoFar = "<div class=\"node currentNode\" onclick=\"vle.renderNode('"+this.id+"');\"><div class=\"type\">" + this.type + "</div></div>";
	} else {
		htmlSoFar = "<div class=\"node\" onclick=\"vle.renderNode('"+this.id+"');\"><div class=\"type\">" + this.type + "</div></div>";
	}
	for (var i=0; i < this.children.length; i++) {
		htmlSoFar += this.children[i].getNavigationHtml();
	}
	return htmlSoFar;
}

Node.prototype.getContentHtml = function() {
	return this.content;
}


Node.prototype.getNodeById = function(nodeId) {
	if (this.id == nodeId) {
		return this;
	} else if (this.children.length == 0) {
		return false;
	} else {
		var soFar = false;
		for (var i=0; i < this.children.length; i++) {
			soFar = soFar || this.children[i].getNodeById(nodeId);
		}
		return soFar;
	}
}